package com.java.exer1;

import java.util.Scanner;

/**
 * 输入阿拉伯数字，以及用逗号分割的偏移量和长度，翻译成汉字 ：例 123 ，1，2  --》二三
 *
 * @author shkstart
 * @create 2021-01-11 11:54
 */
public class StringTest_9 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入你要改变的阿拉伯数字");
        String s1 = sc.next();
        System.out.println("请输入你要截取的首索引和尾索引");
        int a = sc.nextInt();
        int b = sc.nextInt();
        String s2 = s1.substring(a, a + b);

        char[] c1 = s2.toCharArray();

        for (int i = 0; i < c1.length; i++) {

            switch (c1[i]) {

                case '0':
                    System.out.print("零");
                    continue;
                case '1':
                    System.out.print("一");
                    continue;
                case '2':
                    System.out.print("二");
                    continue;
                case '3':
                    System.out.print("三");
                    continue;
                case '4':
                    System.out.print("四");
                    continue;
                case '5':
                    System.out.print("五");
                    continue;
                case '6':
                    System.out.print("六");
                    continue;
                case '7':
                    System.out.print("七");
                    continue;
                case '8':
                    System.out.print("八");
                    continue;
                case '9':
                    System.out.print("九");
                    continue;

            }
        }

    }
}


